﻿package  
{
	import com.ixiyou.utils.math.Line;
	import flash.display.Graphics;
	import flash.display.Sprite;
	import flash.geom.Point;
	import flash.utils.Dictionary;
	import flash.utils.getDefinitionByName;
	import flash.utils.getQualifiedClassName;
	
	/**
	 * 测试line
	 * @author magic
	 */
	public class LineTest extends Sprite
	{
		public function LineTest() 
		{
			var pta:Point = new Point(0, 0);
			var ptb:Point = new Point(100, 100);
			var ptc:Point = new Point(100, 0);
			var ptd:Point = new Point(0, 100);
			var linea:Line = Line.getLineByPoint(pta, ptb);
			var lineb:Line = Line.getLineByPoint(ptc, ptd);
			var pte:Point = linea.crossPoint(lineb);
			graphics.lineStyle(2, 0xff0000);
			graphics.moveTo(pta.x, pta.y);
			graphics.lineTo(ptb.x, ptb.y);
			graphics.moveTo(ptc.x, ptc.y);
			graphics.lineTo(ptd.x, ptd.y);
			graphics.drawCircle(pte.x, pte.y, 5);
		}
	}
}